﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMobile.cshtml";
}
@section css {
    <link href="~/Assets/css/previewImage.css" rel="stylesheet" />
    <link href="~/Assets/css/mui.picker.min.css" rel="stylesheet" />
    <script src="~/Assets/js/mui.picker.js"></script>
    <script src="~/Assets/js/mui.picker.min.js"></script>
    <script src="~/Assets/js/mui.dtpicker.js"></script>
    <style>
        .mui-bar ~ .mui-content .mui-scroll-wrapper {
            top: 44px;
            height: auto;
        }

        .btn_addPic {
            display: block;
            position: relative;
            width: 53px;
            height: 53px;
            overflow: hidden;
            cursor: pointer;
            text-align: center;
        }
        
        .filePrew {
            display: block;
            position: absolute;
            top: 0;
            left: 0;
            width: 53px;
            height: 53px;
            opacity: 0;
        }
    </style>
}
<header class="mui-bar mui-bar-nav">
    <button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left" style="color:white;">
        <span class="mui-icon mui-icon-left-nav" style=""></span>
    </button>
    <h1 class="mui-title" style="color:white;">问题登记</h1>
</header>

<div class="mui-content" style="margin: 5px;" ng-cloak ng-controller="HiddenTroubleController" ng-init="
     BindDepartmentList('Dep_Select');
     GetFactoryArea();
     GetHiddenTroubleType();
     GetHiddenTroubleLevelList();
     GetSourceList();
     Loading = false;
     ImageCount=[0,1,2,3,4];
     FileList=[];
     AddModel={};
     InitImgeUpload('HiddenTroubleForm');
     AddModel.CheckTime = '@DateTime.Now.ToString("yyyy-MM-dd")';
     AddModel.DepartmentId='0';
     InitDatePicker('#datetime',AddModel.CheckTime,AddModel);
     ">
    <form class="mui-input-group">
        <div class="mui-input-row">
            <label>园区</label>
            <select ng-model="AddModel.FactoryAreaId" ng-change="MGetPlaceList(AddModel.FactoryAreaId);">
                <option value="">请选择园区</option>
                <option ng-repeat="x in FactoryArea" value="{{x.Id}}">{{x.ParkName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>场所</label>
            <select ng-model="AddModel.PlaceId">
                <option value="">请选择场所</option>
                <option ng-repeat="x in PlaceList" value="{{x.Id}}">{{x.PlaceName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>位置</label>
            <input type="text" placeholder="地点/部位" ng-model="AddModel.Location" />
        </div>
        <div class="mui-input-row">
            <label>责任部门</label>
            <select id="Dep_Select" ng-model="AddModel.DepartmentId" ng-change="GetEmployeeByDepartment(AddModel.DepartmentId);">
                <option value="0" selected>请选择责任部门</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>责任人</label>
            <select ng-model="AddModel.ResponsibleEmloyeeNo" class="form-control">
                <option value="">请选择责任人</option>
                <option ng-repeat="x in EmployeeList" value="{{x.EmployeeNo}}">{{x.EmployeeNo}}-{{x.EmployeeName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>来源</label>
            <select ng-model="AddModel.SourceId" ng-change="" class="form-control">
                <option value="">请选择来源</option>
                <option ng-repeat="x in SourceList" value="{{x.Id}}">{{x.Source}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>问题等级</label>
            <select ng-model="AddModel.LevelId" ng-change="" class="form-control">
                <option value="">请选择问题等级</option>
                <option ng-repeat="x in LevelList" value="{{x.Id}}" title="{{x.Description}}">{{x.LevelName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>问题分类</label>
            <select ng-model="AddModel.CategoryAreaId" ng-change="GetHiddenTroubleTypeChild(AddModel.CategoryAreaId,'div_typeselect');" class="form-control">
                <option value="">请选择问题分类</option>
                <option ng-repeat="x in CategoryList" value="{{x.Id}}">{{x.TypeName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>问题子类</label>
            <select ng-model="AddModel.TypeId" class="form-control">
                <option value="">请选择问题子类</option>
                <option ng-repeat="x in CategoryChildList" value="{{x.Id}}">{{x.TypeName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>检查日期</label>
            <input type="text" id="datetime" data-options='{}' ng-model="AddModel.CheckTime" readonly>
        </div>
        <div class="mui-input-row">
            <label>登记人</label>
            <input type="text" ng-model="User.UserName" readonly>
        </div>
    </form>
    <p>问题描述</p>
    <div class="mui-input-row" style="margin: 10px 5px;">
        <textarea id="textarea" rows="5" placeholder="问题描述" ng-model="AddModel.Description"></textarea>
    </div>

    <p>整改要求</p>
    <div class="mui-input-row" style="margin: 10px 5px;">
        <textarea id="textarea" rows="5" placeholder="此处输入整改要求" ng-model="AddModel.Requirement"></textarea>
    </div>

    <p>添加照片</p>
    <div class="row image-list" style="margin-top:20px;margin-bottom:50px;display:none;">
        <div style="float:left;margin-left:10px;" ng-repeat="x in ImageCount" id="imagebox_{{x}}">

        </div>
    </div>
	<div class="row image-list">
		<img id="upload_{{x}}" ng-repeat="x in ImageCount" ng-click="InitLxUpload('upload_',x,'HiddenTroubleForm');" src="../../Assets/img/upload.png" class="img-item space" style="width:55px;height:auto;margin:5px;" alt="" title="">
	</div>
    <div class="mui-button-row" style="margin-top:150px;">
        <button type="button" ng-click="AddHiddenTroubleForm(AddModel);" ng-disabled="Loading" class="mui-btn mui-btn-primary mui-btn-block">保 &nbsp;&nbsp;存</button>
    </div>
    <div style="height:80px;"></div>
</div>
@section js{
	<script src="~/Assets/js/base/app-jssdk.umd.min.js"></script>
    <script src="~/Assets/js/libs/upload.js"></script>
    <script src="~/Assets/js/mui.zoom.js"></script>
    <script src="~/Assets/js/mui.previewimage.js"></script>
    <script src="~/Assets/js/pg/MHiddenTrouble.js?v=@DateTime.Now.ToString("yyyyMMddHH")"></script>
    <script>
        mui.showLoading("正在加载..", "div");

        setTimeout(function () {
            mui.hideLoading();
            mui.previewImage();
        }, 2000);
    </script>
}
